#include <iostream>
#include <exception>
using namespace std;
float devide(float a,float b)
{
    if(b == 0)
    {
        
        throw ;
    }
    return a/b;
}
int main()
{
    /*
    int a,b,c,d = 0;
    
    try
    {
        d = 0;
        cin>>a;
        if(a<0) throw a;
        d = d + a*a;
        cin>>b;
        if(b<0) throw b;
        d = d + b * b;
        cout<<"result = "<<d<<endl;
    }
    catch(int e)
    {
        cout<<"input exception:"<<e<<endl;
    }
    */
   /*
    float a,b,c;
     try
     {
        cin>>a>>b;
        c = devide(a,b);
        cout<<c;  
     }
     catch(int e)
     {
      cout<<"devide by zero"<<endl;  
     }
     */
    string s("123");
    int aa[3];
    try{
        string s1  = s.substr(2);
        
    }catch(const std::exception & e)
    {
        cout<<"catch::"<<e.what()<<endl;
    }
    

}